
lst = [3,5,1,7,9,6,8]

for i in range(len(lst)-1):
    flag = i
    for j in range(i+1,len(lst)):
        if lst[j] < lst[flag]:
            flag = j
    if flag != i:
        lst[i],lst[flag] = lst[flag],lst[i]
print(lst)


logs = '''
111.30.144.7 "POST /mock/login/?t=GET HTTP/1.1" 200 
111.30.144.7 "Get /mock/users/?t=POST HTTP/1.1" 200 
111.13.100.92 "Post /mock/login/ HTTP/1.1" 200 
223.88.60.88 "GET /mock/users/?t=POST HTTP/1.1" 200 
111.30.144.7 "GET /mock/users/ HTTP/1.1" 200 
'''
lst = logs.split(" ")
lst = lst[1::5] #得到只包含 post get 的字符串
for i in range(len(lst)):
    lst[i]=lst[i].replace("\"","") #处理"字符
    lst[i] = lst[i].upper() #处理大小写
num_of_post = lst.count("POST")
num_of_get = lst.count("GET")
result = "POST {}\nGET {}".format(num_of_post,num_of_get)
print(result)


